package com.example.a10928.weifriend.adapter;

import android.text.TextUtils;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.a10928.weifriend.R;
import com.example.a10928.weifriend.http.api.base.VIPBean;
import com.example.a10928.weifriend.view.TitleLayout;

import java.util.List;

public class MyTeamAdapter extends BaseQuickAdapter<VIPBean, BaseViewHolder> {

    String type;
    TitleLayout titleLayout;
    public MyTeamAdapter(int layoutResId, List<VIPBean> data, String type, TitleLayout titleLayout) {
        super(layoutResId, data);
        this.type=type;
        this.titleLayout=titleLayout;
    }

    @Override
    protected void convert(BaseViewHolder helper, VIPBean item) {
        if(TextUtils.isEmpty(type)){

            helper.setText(R.id.tv_level,item.name).setText(R.id.tv_num,item.num+"");
        }else if(type.equals("0")){
            titleLayout.setTitle("一级会员");
            helper.setText(R.id.tv_level,item.name).setText(R.id.tv_num,item.num+"");

        }else{
            titleLayout.setTitle("二级会员");
            helper.setText(R.id.tv_level,item.name).setText(R.id.tv_num,item.num+"");
        }



    }
}
